'''
form-data 表单格式的请求数据其实也是挺常见的
FastAPI 通过 Form 来声明参数需要接收表单数据

pip3 install python-multipart
'''
import uvicorn
from fastapi import FastAPI, Body, Form

app = FastAPI()


@app.post('/login')
def login(username: str = Form(...), password: str = Form(...)):
    return {"username":username, "password": password}

if __name__ == '__main__':
    uvicorn.run(app="main:app", host="127.0.0.1", port=8000, reload=True, debug=True)